package com.xiaofan.service;


import com.xiaofan.bean.User;
import com.xiaofan.mapper.UserMapper;
import org.springframework.stereotype.Component;

@Component
public class UserServiceImpl implements UserService{
    
    UserMapper userMapper;

    public User queryNameById(Integer id){
        //sqlSession = MyBatisUtil.getSqlSession();
        //UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        User s = userMapper.selectNameById(id);
        //sqlSession.commit();
        //sqlSession.close();
        return s ;
    }

    public int insertUser(User user){
        //sqlSession = MyBatisUtil.getSqlSession();
        //UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        int i = userMapper.insertUser(user);
        //sqlSession.commit();
        //sqlSession.close();
        return i;
    }
}
